home *** CD-ROM | disk | FTP | other *** search
/ Animation How-To / Animation How-to CD.iso / PLY / CHAPTER4 / IMPACT / SPLASH.BAS < prev   
BASIC Source File  |  1994-01-01  |  1KB  |  52 lines

  1. ' SPLASH.BAS
  2.  
  3. SCREEN 12
  4. WINDOW (-1, -1.5)-(141, 2)
  5. LINE (0, -1)-(140, 5), , B
  6.  
  7. pi = 3.14159
  8. rad = pi / 180
  9.  
  10. FOR y = 0 TO 5
  11.    LINE (0, y)-(140, y)
  12. NEXT y
  13.  
  14. FOR x = 0 TO 140 STEP 20
  15.   LINE (x, -1)-(x, 5)
  16. NEXT x
  17.  
  18. FOR frame = 0 TO 140
  19.  
  20.    'VVVVVVVVVVVVVVVVVVVVVVVV
  21.    ' The spreading wavefront
  22.    'AAAAAAAAAAAAAAAAAAAAAAAA
  23.  
  24.    IF (frame < 40) THEN
  25.                     center = COS((frame) * 4.8 * rad) + 1
  26.    ELSE
  27.       center = (frame - 40) / 20
  28.    END IF
  29.  
  30.    ' VVVVVVVVVVVVVVVVVVVVVVVVVVV
  31.    ' The height of the wavefront
  32.    ' AAAAAAAAAAAAAAAAAAAAAAAAAAA
  33.  
  34.    IF (frame < 20) THEN
  35.       decline = 0
  36.    ELSE
  37.       IF (frame < 50) THEN
  38.        'expando goes from 0 to 1 between frames 20 and 50
  39.        'this makes the gain on the sine wave go from -.65 to -1.3
  40.        expando = ((frame - 20) / 30)
  41.        decline = -(.75 + expando*.65) * SIN(9 * (frame - 20) * rad)
  42.    ELSE
  43.       decline = 5 / EXP(frame / 40)
  44.    END IF
  45. END IF
  46.  
  47. CIRCLE (frame, center), .2, 2
  48. CIRCLE (frame, decline), .2, 3
  49.  
  50.  
  51. NEXT frame
  52.